home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows 95 with MFC / Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso / CODE / Chap04 / Paint1 / Paint1.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-05  |  1.2 KB  |  57 lines

  1. //***********************************************************************
  2. //
  3. //  Paint1.h
  4. //
  5. //***********************************************************************
  6.  
  7. class CLine : public CObject
  8. {
  9. private:
  10.     CPoint m_ptFrom;
  11.     CPoint m_ptTo;
  12.     UINT m_nWidth;
  13.     COLORREF m_crColor;
  14.  
  15. public:
  16.     CLine (CPoint, CPoint, UINT, COLORREF);
  17.     virtual void Draw (CDC*);
  18. };
  19.  
  20. class CMyApp : public CWinApp
  21. {
  22. public:
  23.     virtual BOOL InitInstance ();
  24. };
  25.  
  26. class CMainWindow : public CFrameWnd
  27. {
  28. private:
  29.     UINT m_nColor;
  30.     UINT m_nWidth;
  31.     CPoint m_ptFrom;
  32.     CPoint m_ptTo;
  33.     CObArray m_lineArray;
  34.  
  35.     void InvertLine (CDC*, CPoint, CPoint);
  36.     void DeleteAllLines ();
  37.  
  38. public:
  39.     CMainWindow ();
  40.     ~CMainWindow ();
  41.  
  42. protected:
  43.     afx_msg void OnPaint ();
  44.     afx_msg void OnFileNew ();
  45.     afx_msg void OnUpdateFileNewUI (CCmdUI*);
  46.     afx_msg void OnFileExit ();
  47.     afx_msg void OnWidth (UINT);
  48.     afx_msg void OnUpdateWidthUI (CCmdUI*);
  49.     afx_msg void OnColor (UINT);
  50.     afx_msg void OnUpdateColorUI (CCmdUI*);
  51.     afx_msg void OnLButtonDown (UINT, CPoint);
  52.     afx_msg void OnMouseMove (UINT, CPoint);
  53.     afx_msg void OnLButtonUp (UINT, CPoint);
  54.  
  55.     DECLARE_MESSAGE_MAP ()
  56. };
  57.